package cn.zqy.demo.day08;
// 3种，toCharArray(), getBytes, public String replace(CharSequence oldStr, CharSequence newStr)
//CharSequence可以接受字符串类型
public class Demo05StringConvert {
    public static void main(String[] args) {
        String str1 = "Hello World!!!";
        /*1.toCharArray,拆分为字符数组*/
        char[] c = str1.toCharArray();
        System.out.println(c[0]); // H


        /*2.getBytes, 拆分为字节数组 */
        byte[] bytes = str1.getBytes();
        System.out.println(bytes[0]);  //72

        /*3.replace, 替换字符*/
        String str2 = str1.replace("l", "#");
        System.out.println(str2);
    }
}
